* Project: Child learning and school feeding
*** Caterers data analysis
* EA, 25 September 2020

use   "cat_level.dta", clear

	* recode data on meals
	
	gen no_meal_m1 = mname == "NO MEAL" 
	gen no_meal_m2= nmae2  =="NO MEAL" 
	
	gen only_cereal_m1 = mname == "BANKU"  
	gen only_cereal_m2= nmae2=="BOMBIKA" 
	
	gen cer_legumes_m1 = mname == "ADJUA(Cowpea with gari)" |  mname == "BEAN AND GARI" |  mname == "BEANS AND GARI" | ///
	mname =="GARI AND BEANS" | mname =="RICE AND BEANS" | mname=="RICE AND BEANS STEW" | mname == "YAM AND BEANS STEW" | ///
	mname =="YAM WITH BEANS STEW" 
	
	gen cer_legumes_m2= nmae2=="BEANS AND GARI" | nmae2=="GARI AND  BEANS" | nmae2 == "GARI AND BEANS" | ///
	nmae2 =="MAIZE AND BEANS" | nmae2 == "MAIZE WITH BEANS" | nmae2 =="RICE AND BEANS" | nmae2=="RICE AND BEANS STW" | ///
	nmae2=="T Z  WITH OKRO SUOP" | nmae2=="TUO ZAAFI" | nmae2=="YAM AND BEANS" | nmae2=="YAM AND BEANS STEW"
	
	gen cer_veg_m1 = mname =="T.Z" | mname == "TUO ZAAFI WITH OKRO SOUP" | mname =="TZ AND OKRO SUOP" | ///
	mname =="RED RED" | mname == "RICE WITH TOMATO STEW" 
	
	gen cer_veg_m2 = nmae2=="RED RED" | nmae2=="WAAKYE WITH TOMATO STEW" | nmae2=="YAM WITH CABBAGE STEW" | nmae2 =="YAM WITH CABBAGE STEW"

	gen cer_animal_m1= mname == "BANKU AND GROUNDNUT SOUP" | mname =="BANKU AND PALM NUT SOUP" | mname == "BANKU WITH GROUNDNUT SOUP" | ///
	mname == "GARI AND GROUNDNUT SOUP WITH FISH"  | mname == "JALLOF"  | mname =="JOLLOF" | mname =="JOLLOF RICE" | ///
	mname == "KPAASA(CUSCUS)" | mname == "RICE AND SOUP" | mname =="RICE AND STEW"  | mname == "RICE STEW" | mname == "RICE WITH STEW" | ///
	mname=="banku and stew" 
	
	gen cer_animal_m2= nmae2 =="JALLOF" | nmae2 =="BANKU WITH GROUNDNUT SOUP"  | nmae2 =="JOLLOF RICE" |  nmae2 =="JOLLOF RICE WITH FISH" | ///
	nmae2 =="PLAIN RICE AND STEW" | nmae2 == "RICE AND STEW" |  nmae2 == "RICE BALL WITH GROUNDNUT SOUP" |  nmae2 == "YAM PORAGE" |  nmae2 =="YAW WITH STEW" |  ///
	nmae2 == "jollof rice" | nmae2 =="rice and fish stew"
	
	su no_meal_m1 - cer_animal_m2
	
	egen mean_nomeal=rowmean(no_meal_m1 no_meal_m2)
	egen mean_only_cer=rowmean(only_cereal_m1 only_cereal_m2)
	egen mean_cer_leg=rowmean(cer_legumes_m1 cer_legumes_m2)
	egen mean_cer_veg= rowmean(cer_veg_m1 cer_veg_m2)
	egen mean_cer_anim=rowmean(cer_animal_m1 cer_animal_m2)
	
	su mean_nomeal - mean_cer_anim
	
	graph hbar mean_cer_leg mean_cer_anim  , over(region) perc ytitle("Percent of meals") 
	
	graph hbar mean_nomeal mean_only_cer mean_cer_leg mean_cer_veg mean_cer_anim , over(region) stack ///
	legend(order(1 "No Meal" 2 "Only starchy" 3 "Starchy and legumes" 4 "Starchy and vegetables" 5 "Starchy and animal protein")) ///
	graphregion(color(white)) scheme(s2mono)
	
	gen north=region>=8 & region <=10
	label define north 1 "Northern" 0 "Southern"
	label values north north
	
	* Revised figure:
	graph hbar mean_nomeal mean_only_cer mean_cer_leg mean_cer_veg mean_cer_anim , over(north) stack ///
	legend(order(1 "No Meal" 2 "Only starchy foods" 3 "Starchy and legumes" 4 "Starchy and vegetables" 5 "Starchy and animal protein")) ///
	graphregion(color(white)) scheme(s2mono)
	
	*(and changed the colors manually)
